const cryptoJs = require("crypto-js");
//海康解密
export const Decrypt = (word, keyStr) => {
  keyStr = keyStr ? keyStr : 'hangzhoucxdy601@'
  let key = cryptoJs.enc.Utf8.parse(keyStr)

  let decrypt = cryptoJs.AES.decrypt(word, key, {
    mode: cryptoJs.mode.ECB,
    padding: cryptoJs.pad.Pkcs7,
  })
  return decrypt.toString(cryptoJs.enc.Utf8).toString()
}
export function randomUserID() {
  return new Date().getTime().toString(16).split('').reverse().join('');
}
export function randomRoomID() {
  return parseInt(Math.random() * 9999);
}